import { createApp } from 'vue'
import App from './App.vue'
import "./assets/css/default.css"; // 动态换肤

import router from '@/router'
import store from '@/store'

// UI库 element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// svg icon 引⼊
import '@/icons'

// 路由导航
import './permission'

// 按钮权限
import vPermission from "./directives/permission";

// 可视化图表 echarts
import * as echarts from 'echarts'

// MarkDown 
import VueMarkdownEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
import Prism from 'prismjs';
VueMarkdownEditor.use(vuepressTheme, {
  Prism,
});

import print from 'vue3-print-nb'

const app = createApp(App)
app.directive('permission', vPermission)
app.config.globalProperties.$echarts = echarts

// element-plus的icon 全局注册
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(VueMarkdownEditor)
app.use(ElementPlus)
app.use(router)
app.use(store)
app.use(print)
app.mount('#app')
